<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:pt="http://xmlns.jcp.org/jsf/passthrough"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
    <h:head>
        <title>iNET- Tiện ích văn phòng</title>
        <meta charset="UTF-8" />
        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
        <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
        <link rel="shortcut icon" href="/TienIchVanPhong/resources/images/logo.png" />
        <h:outputStylesheet library="css" name="menu.css"/>
        <h:outputStylesheet library="css" name="style.css"/>
        <h:outputStylesheet library="css" name="BeatPicker.min.css"/>
        <h:outputScript library="js" name="jquery-1.11.0.min.js"/>
        <h:outputScript library="js" name="BeatPicker.min.js"/>

    </h:head>
    <h:body>
        <h:form id="frmUpdate">

            <!--Start header-->
            <ui:include src="/resources/template/header.xhtml"/>
            <!--end header-->

            <div class="main">
                <!-- Menu left-->

                <ui:include src="/resources/template/left.xhtml"/>

                <!--end menu left-->

                <!--nội dung-->
                <div class="right"> <br/>
                    <p align="center"><b>CẬP NHẬT THÔNG TIN</b></p>
                    <div class="controll">
                        
                        <table style="margin: 0 auto;">
                            <tr>
                                <td>
                                    <table class="tblemp" >
                                        <tr>
                                            <td colspan="3">
                                            <p style="margin: 10px;color: red" align="center"> <h:messages  style="color: red;list-style: none;text-align: center"/> </p>
                                            </td> 
                                        </tr>
                                        <tr>
                                            <td colspan="3">
                                                <p style="margin: 10px" align="center"><b>Thông tin nhân viên</b></p> 

                                            </td>  
                                            

                                        </tr>
                                        <tr>
                                            <td class="rowemp">Mã nhân viên:</td>
                                            <td class="rowemp1">
                                                <h:inputText 
                                                    value="#{userController.empLogin.emp_code }"
                                                    pt:readonly="true" style="background-color: #999" class="inputadd" 
                                                    id="manv" title="Phải nhập từ 6-20 ký tự" pt:pattern="[0-9A-Za-z]{6,20}" 
                                                    pt:placeholder="Mã nhân viên" pt:required=""/>
                                            </td>
                                            <td class="rowemp2">(*)</td>
                                        </tr>
                                        <tr>
                                            <td class="rowemp">Họ và tên đệm:</td>
                                            <td class="rowemp1">
                                                <h:inputText 
                                                    value="#{userController.empLogin.first_name }"
                                                    class="inputadd" id="honv" title="Không được dùng sô và ký tự đặc biệt"
                                                    pt:pattern="[^0-9\\~\\!\\@\\#\\$\\%\\^\\*\\(\\)\\-\\_\\=\\+\\.\\,\\/\\?\\'\\:\\;\\>]{2,50}" 
                                                    pt:placeholder="Họ và tên đệm" pt:required=""/>
                                            </td>
                                            <td class="rowemp2">(*)</td>
                                        </tr>
                                        <tr>
                                            <td class="rowemp">Tên :</td>
                                            <td class="rowemp1">
                                                <h:inputText 
                                                    value="#{userController.empLogin.last_name }"
                                                    class="inputadd" id="tennv" title="Không được dùng số và ký tự đặc biệt" 
                                                    pt:pattern="[^0-9\\~\\!\\@\\#\\$\\%\\^\\*\\(\\)\\-\\_\\=\\+\\.\\,\\/\\?\\'\\:\\;\\>]{2,50}" 
                                                    pt:placeholder="Tên nhân viên" pt:required=""/>
                                            </td>
                                            <td class="rowemp2">(*)</td>
                                        </tr>                                        
                                        <tr>
                                            <td class="rowemp">Số điện thoại:</td>                            
                                            <td class="rowemp1">
                                                <h:inputText 
                                                    value="#{userController.empLogin.emp_mobile }"
                                                    class="inputadd" id="sdt" pt:placeholder="Số điện thoại" 
                                                    pt:pattern="[0]+[1-9]{9,10}"
                                                    pt:required=""/>
                                            </td>
                                            <td class="rowemp2">(*)</td>
                                        </tr>
                                        <tr>
                                            <td class="rowemp">Email:</td>
                                            <td class="rowemp1">
                                                <h:inputText value="#{userController.empLogin.emp_email }"
                                                             class="inputadd" id="email" pt:type="email" pt:placeholder="Email" pt:required=""
                                                             pt:pattern="[a-z0-9._%+-]+@[a-z0-9.-]+\.[a-z]{2,3}$"
                                                             />
                                            </td>
                                            <td class="rowemp2">(*)</td>
                                        </tr>
                                        <tr>
                                            <td class="rowemp">Địa chỉ:</td>
                                            <td class="rowemp1">
                                                <h:inputText 
                                                    value="#{userController.empLogin.address }"
                                                    class="inputadd" id="diachi" pt:placeholder="Địa chỉ" 
                                                    pt:required=""/>
                                            </td>
                                            <td class="rowemp2">(*)</td>
                                        </tr>
                                        <tr>
                                            <td class="rowemp">Ngày sinh:</td>
                                            <td class="rowemp1">
                                                <h:inputText class="inputadd" value="#{userController.empLogin.emp_dob}" id="ngaysinh" pt:placeholder="Ngày sinh" 
                                                             pt:required=""
                                                             pt:data-beatpicker="true" 
                                                             pt:data-beatpicker-position="['right','bottom']"
                                                             pt:data-beatpicker-format="['DD','MM','YYYY']" 
                                                             pt:data-beatpicker-module="clear"
                                                             pt:data-beatpicker-extra="customOptions"   
                                                             >
                                                    <f:convertDateTime pattern="dd-MM-yyyy" ></f:convertDateTime>
                                                </h:inputText>
                                                <script type="text/javascript">
                                                    customOptions = {
                                                        labels: {
                                                            today: "Hôm nay",
                                                            gotoDateInput: "",
                                                            gotoDateButton: "Đến",
                                                        }
                                                    }
                                                </script>
                                            </td>
                                            <td class="rowemp2">(*)</td>
                                        </tr>
                                        <tr>
                                            <td class="rowemp">Nơi sinh:</td>
                                            <td class="rowemp1">
                                                <h:inputText value="#{userController.empLogin.birth_place }"
                                                             class="inputadd" id="noisinh" 
                                                             pt:placeholder="Nơi sinh" 
                                                             pt:required=""/>
                                            </td>
                                            <td class="rowemp2">(*)</td>
                                        </tr>
                                        <tr>
                                            <td class="rowemp">Giới tính:</td>
                                            <td class="rowemp1">
                                                <h:selectOneMenu value="#{userController.empLogin.gender}" id="gioitinh" class="chonadd" pt:required="" >                                                 
                                                    <f:selectItem itemValue="0" itemLabel="Nam" /> 
                                                    <f:selectItem itemValue="1" itemLabel="Nữ" />                                       
                                                </h:selectOneMenu>
                                            </td>
                                            <td class="rowemp2">(*)</td>
                                        </tr>
                                        <tr>
                                            <td class="rowemp">Quốc tịch:</td>
                                            <td class="rowemp1">
                                                <h:inputText
                                                    pt:readonly="true" style="background-color: #999"
                                                    value="#{userController.empLogin.nationality }"
                                                    class="inputadd" id="quoctich"
                                                    pt:placeholder="Quốc tịch" pt:required=""
                                                    pt:pattern="[^0-9\\~\\!\\@\\#\\$\\%\\^\\*\\(\\)\\-\\_\\=\\+\\.\\,\\/\\?\\'\\:\\;\\>]{2,50}"
                                                    />
                                            </td>
                                            <td class="rowemp2">(*)</td>
                                        </tr>
                                        <tr>
                                            <td class="rowemp">Trình độ văn hóa:</td>
                                            <td class="rowemp1">
                                                <h:inputText
                                                    pt:readonly="true" style="background-color: #999"
                                                    value="#{userController.empLogin.lyteracy }"
                                                    class="inputadd" id="tdvh" pt:placeholder="Trình độ văn hóa" pt:required=""/>
                                            </td>
                                            <td class="rowemp2">(*)</td>
                                        </tr>
                                    </table>                
                                </td>
                            </tr>

                            <tr>                        
                                <td>
                                    <table class="tblemp1">
                                        <tr>
                                            <td></td>
                                            <td class="btnaddemp">
                                                <h:commandButton styleClass="btnSubmid" onclick="if (!confirm('Bạn muốn thay đổi?'))return false;" 
                                                                 value="Cập nhật " actionListener="#{userController.updateByEmp()}"/>
                                                <h:commandButton styleClass="btnSubmid" value="Làm lại" type="reset"/>
                                                
                                            </td>
                                            <td></td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </div>
                    <br/>
                    <br/>                      
                </div>
                <!-- end dội dung-->
            </div>
            <!--Footer-->
            <ui:include src="/resources/template/footer.xhtml"/>
            <!--end footer-->
        </h:form>
    </h:body>
</html>

